﻿
--USE CodeCamp;
GO
	Declare @SqlError int, @MigrationId NVARCHAR(255), @MigrationId_found NVARCHAR(255),
			@TableName NVARCHAR(128) Set @TableName = N'cc_UsersInEventRoles_NEW';
	SET @MigrationId = '201208161218375_AlterUserInEventRole';
	
	SELECT @MigrationId_found = MigrationId
	From dbo.[__MigrationHistory]
	Where MigrationId = @MigrationId;
	Select @SqlError=@@ERROR;
	Print 'SQL Error = ' + IsNull(Convert(Varchar,@SqlError),'null')
		+ ', MigrationId found = "' + IsNull(@MigrationId_found,'[null]') + '"';
		
	If @MigrationId_found is not null Begin
	
		RAISERROR('Migration already completed.', 16, 1);
	
	End Else Begin
	
		IF (EXISTS (SELECT name FROM sysobjects WHERE (name = @TableName) AND (type = 'U'))) BEGIN
			Print 'Table ' + IsNull(@TableName,'???') + ' exists.'
		END ELSE BEGIN
			CREATE TABLE [dbo].[cc_UsersInEventRoles_NEW](
				[Role4EventId] [int] NOT NULL,
				[SiteUserId] [int] NOT NULL,
				[EventId] [int] NOT NULL,
				[CreatedUTC] [datetime] NOT NULL,
				[CreatedBy] [nvarchar](128) NOT NULL,
			 CONSTRAINT [PK_cc_UsersInEventRoles2] PRIMARY KEY CLUSTERED 
			(
				[Role4EventId] ASC,
				[SiteUserId] ASC
			));
			Print 'Created Table ' + IsNull(@TableName,'???')
		END
	
	End;
GO

Declare @DoChange bit Set @DoChange=0;
--Declare @DoChange bit Set @DoChange=1;

If @DoChange=1 Begin

	Declare @SqlError int, @MigrationId NVARCHAR(255), @MigrationId_found NVARCHAR(255);

	SET @MigrationId = '201208161218375_AlterUserInEventRole';
	
	SELECT @MigrationId_found = MigrationId
	From dbo.[__MigrationHistory]
	Where MigrationId = @MigrationId;
	Select @SqlError=@@ERROR;
	Print 'SQL Error = ' + IsNull(Convert(Varchar,@SqlError),'null')
		+ ', MigrationId found = "' + IsNull(@MigrationId_found,'[null]') + '"';
		
	If @MigrationId_found is not null Begin
	
		RAISERROR('Migration already completed.', 16, 1);
	
	End Else Begin

		IF ISNULL(@SqlError,-1) = 0 Begin

			BEGIN TRANSACTION

			Declare @EventRoles TABLE
			(
				RoleId int
				,RoleName nvarchar(128)
			)

			Print 'Select RoleName entries for EventRoles';
			Insert @EventRoles
			Select
				Distinct
				ur.RoleId
				,r.RoleName
			From cc_UsersInEventRoles ur 
			Inner Join cc_Roles r on
				r.Id = ur.RoleId

			--Select * From @EventRoles
			
			Print 'INSERT cc_Roles4Events'
			
			SET IDENTITY_INSERT cc_Roles4Events ON
			INSERT cc_Roles4Events (Id, RoleName)
			Select DISTINCT RoleId, RoleName
			from @EventRoles
			Order by RoleId
			;
			Select @SqlError=@@ERROR;
			Print 'SQL Error = ' + IsNull(Convert(Varchar,@SqlError),'null')
			SET IDENTITY_INSERT cc_Roles4Events OFF
			
			IF ISNULL(@SqlError,-1) = 0 Begin

				INSERT cc_UsersInEventRoles_NEW (Role4EventId, SiteUserId, EventId, CreatedUTC, CreatedBy)
				Select
					RoleId,
					SiteUserId,
					EventId,
					CreatedUTC,
					CreatedBy
				From cc_UsersInEventRoles
				Order by CreatedUTC
				Select @SqlError=@@ERROR;
				Print 'SQL Error = ' + IsNull(Convert(Varchar,@SqlError),'null')

				--IF ISNULL(@SqlError,-1) = 0 Begin

					--ALTER TABLE [cc_UsersInEventRoles] DROP CONSTRAINT [FK_cc_UsersInEventRoles_cc_Roles_RoleId]
					--DROP INDEX [IX_RoleId] ON [cc_UsersInEventRoles]
					--ALTER TABLE [cc_UsersInEventRoles] ADD [Role4EventId] [int] NOT NULL DEFAULT 0
					--ALTER TABLE [cc_UsersInEventRoles] DROP CONSTRAINT [PK_cc_UsersInEventRoles]
					
					--***** no default constraints for this table *****
					--DECLARE @var0 nvarchar(128)
					--SELECT @var0 = name
					--FROM sys.default_constraints
					--WHERE parent_object_id = object_id(N'cc_UsersInEventRoles')
					--AND col_name(parent_object_id, parent_column_id) = 'RoleId';
					--IF @var0 IS NOT NULL
					--	EXECUTE('ALTER TABLE [cc_UsersInEventRoles] DROP CONSTRAINT ' + @var0)

				--End;

				IF ISNULL(@SqlError,-1) = 0 Begin
				
					--Print 'Rename column from RoleId to Role4EventId';
					--EXEC sp_rename 'cc_UsersInEventRoles.RoleId', 'Role4EventId', 'COLUMN';
					Print 'Rename table from cc_UsersInEventRoles to cc_UsersInEventRoles_OLD';
					EXEC sp_rename 'cc_UsersInEventRoles', 'cc_UsersInEventRoles_OLD'; --, 'TABLE';
					Print 'Rename table from cc_UsersInEventRoles_NEW to cc_UsersInEventRoles';
					EXEC sp_rename 'cc_UsersInEventRoles_NEW', 'cc_UsersInEventRoles'; --, 'TABLE';
					
					--ALTER TABLE [cc_UsersInEventRoles] ADD CONSTRAINT [PK_cc_UsersInEventRoles] PRIMARY KEY ([Role4EventId], [SiteUserId])
					ALTER TABLE [cc_UsersInEventRoles] ADD CONSTRAINT [FK_cc_UsersInEventRoles_cc_Roles4Events_Role4EventId] FOREIGN KEY ([Role4EventId]) REFERENCES [cc_Roles4Events] ([Id])
					CREATE INDEX [IX_Role4EventId] ON [cc_UsersInEventRoles]([Role4EventId])
					--ALTER TABLE [cc_UsersInEventRoles] DROP COLUMN [RoleId]
					
					Print 'Drop cc_UsersInEventRoles_OLD'
					DROP TABLE cc_UsersInEventRoles_OLD;
					Select @SqlError=@@ERROR;
					Print 'SQL Error = ' + IsNull(Convert(Varchar,@SqlError),'null')
				End;
				
				IF ISNULL(@SqlError,-1) = 0 Begin
						
					Print 'Delete event roles from cc_Roles';
					Delete cc_Roles
					Where Id in (Select RoleId From @EventRoles);
					Select @SqlError=@@ERROR;
					Print 'SQL Error = ' + IsNull(Convert(Varchar,@SqlError),'null')

				End;				
			End;
			
			--Uncomment next line to force rollback when testing
			--If (ISNULL(@SqlError,-1) = 0) Set @SqlError = -1;

			If ISNULL(@SqlError,-2) != 0 Begin
				Declare @SE int;
				Set @SE = ISNULL(@SqlError,-2);
				ROLLBACK TRANSACTION
				RAISERROR('Error (%d) updating cc_UsersInEventRoles - transaction rolled back.', 16, 1, @SE);
			End Else Begin
				COMMIT TRANSACTION
				PRINT 'Schema change completed for id ' + IsNull(@MigrationId,'???');
				INSERT INTO [__MigrationHistory] ([MigrationId], [CreatedOn], [Model], [ProductVersion]) VALUES (@MigrationId, '2012-08-16T12:19:59.559Z', 0x1F8B0800000000000400ED3DDB72DC3A8EEF5BB5FFE0F2E3544DDAC9C9C9E44C3933E5D8C98C6B9CC4E54ECE7974C9DD4C5B15B5D423A973995FDB87FDA4FD852575A5488004756FC70F49B5490A040110E00500FFEF7FFEF7F4EFDFB7C1D15716277E14BE3A7EFAE4E4F88885AB68ED879B57C7FBF4F39F5F1EFFFD6FFFFD5FA76FD6DBEF47BF97ED9E8976FCCB3079757C9FA6BBBF2E16C9EA9E6DBDE4C9D65FC551127D4E9FACA2EDC25B478B6727272F174F4F168C8338E6B08E8E4E6FF661EA6F59F607FFF33C0A576C97EEBDE05DB466415294F39A6506F5E8BDB765C9CE5BB157C7E7BCC5B9B7DD3D79F3F6E2ECEAF8E82CF03D8EC592059F1D513AF94DA0745C75C6BB7BC3D14A7F7CFCB1635997AF8E5F7B61C8D61FBD8DDC8C37FC17FBD128E045D771B46371FAE3867D2E3EBE5C1F1F2D9ADF2DD40FABCFA46F44FFFC5798FEF2ECF8E8FD3E08BCBB80177CF682841D1FED5EFC75994631FB070B59ECA56C7DEDA5298B43F12DCBF02FE8F0D7DD0B1A297E5B9C3C13A458F0C146A99772166B882B688AFF4B449769CCA5E5F8E8ADFF9DADAF58B849EF2B64DF79DFCB92A7CF5E1E1F7D0A7D2E5CFCA334DE33607072AFA78B9A1D6626EDFD4008EC238F1A68BEF9CABBB2E33A3DA379AFEFBDAFFE261B153488E3A31B1664B5C9BDBFCB27FB9392EBB74593B771B4BD8902491EF29ADB65B48F5762101158FDD18B372CA563741345DB04C448D4DC56C22821D4A8A83A2CF169D696D8B69A0939291EA7818CE6859FEC02EFC74882AC74BEBC8FE2B445D7829CDD7A2E867DC1C9EED8F78BE73DF57D15AD0A0E8D4DF61BB6F19334CE7AFF140713F09D2562A5B4DCDF6DFDEC57F261C72A4208A67CF4B77D803D0FA28475869B9B8AE47A7F17F8AB12DAEB88AB272F6CCBFD2597FC0FF19AC515766CE56F3DCE8CEB98FF2A169C9CD2CB952760BBDBA60CEB65EAC5A92CE5AD89C0F15E457CB9B7128A2A660907CE62DEE6B31FB0F3BC82E37C1604D137B6EE4A24B1B05DEF03D617D1AF633F8A33821418DFB07DC27A42F63D378219964507ECABCFBE09E3E5AAD54E0CF32AFF9B6A854B7B095B62F2DA40B5C5C8D2818AD579B4DDEE436ED7963B8E4F14C3D8A9AD742CE1161AB6483357AC2FC3B5FFD55FF3ED171773CEC9BB7D8AA10E36D5F13734D306616AEB3A926ADAC2D857D53AC64A9586A55AEF8A59A1B961BC8A4A1DAB46858653B3B62546169215B0F5B6359248136DDD8DB5735D802F77CCFBC2E21BAEE73390084D95560071C1163A95E166CEE4366904541198E77FB769FFD143B427AFD031A90A352CEA1A770C922F180AC9170887B21440A2AA72C6822F16922042E4A8AC05B069D4E81835AB3BEDEB5445FFB8C53BD8930EA5D716BB939367EE1BB416E72BAD5729AADEB72C665A4D0870D1F0382BFA9F156FFD38697380D1C3D4B8F246EBB9C5F4E86125AC4E14CAAAB9D56CA9165B8F33A4FF19B2F453F62961B1010EB8B5FD29279ABAF4FAE60BAEF7DE3985E06FB69E1F9CADD77C6E2413D8FD4C627249BF4C927D7D4C46C4E1D9AF2FFAC4815771D5333516E781E76F05023340C311855F9F763EB2E75FFF7BCF6A443EFBCEFC787AF2ABE98C8D4C898C0283CD10CAF4FC83DD2542B3F6BD3EA6F4FD3A88369374FC2EBAF303767D1F85CE33C0F96855BBA9F2E374E9FFC7591177EDF83C66C2FE7FFA78EE7E82DF62DDE67006A8AECFB03342F21150B152B0E0553783502B6B0DD8554D9C11241D09AAAD6EEBE5A57E7409B4C2CE31A1A6EEA76CD5615DF1D37A3A58FC44466168673A29D41BB73ECA7EED479BD8DBDDFBCC72A85D36FC010FC5D40E3FEE861A773ACAAAA4FB712BF2D32FFF1F97E08F4BF0992DC167B1F6BDDC9DF1A5D826DCEF5C29D0753176999CED765C0EBBFB0C5C2657D1EA0B5B7FD8A75D41090575156DFCD0B246A40C50C0FA10067EC8CE56A9FF954B5A0F400BBFE86A9C7EE8C5DC6808B7E67D1CB370F5E35DC6918C7B5626F29F3A02B8913A8FB6BB7D2AE00E6EA4BA2CD56150AF7F4CA0F7776BC228287C2F20F53C08BD67FAE24A5949B75964551FEBAB2DB07DD1679BB559A3AB4E67B0350E4E60ECABEF617640EADE8DB05972DCC3D1F0AE1A1BB02EBD4CAC38970D3B5D5594183DEE0E7ABFA8F8E8A7CE1E7B3DA8DB0B96AC627FD7C211F8F9C949E7C3CC429EDE71CEC53EFFA06F6FE0199E7011BDC990F9DCF66CABF0675D9B1DDD9456A00242DAE8C72D58C3613CE13A294FEB915747DC515FAEBADE80AF548B612A37E976FEA370ED51D36BD14553AD8610BFB8FE5655627034BD90B73428852C684A536160AB5E57505D1498155DD30A8AE2C14843B96E6DC0B9F25EB4225DB5ECB4EECB18FEA80AA0108703716CB4866A74899954A5108EA81C78B142534AD6654A4375B59A2CD50C7E9C300FC40DB89700B62C142EFF3287D42E16305CBBC368B14D213BD6AB731FF1BB1F78F2BB594DAB12D0EC6B97D392C7FC14432D813D77EBDBE5648EBE4D4376EFD04ECE211EC8865BD604C42BEB18C729FFD7617DF828E2876CEDDA980773109A6614B4F0B4014E50CCE26F38399167473B45AFB9163DCE8681AE9272F2BA9F139B1D20DCA2DB2DD74F7D38AF69CA9AE2E9D62DFAA4F2257B94DD616457840D651A73F86B9696A2DB8BB322EAF96AF26CECAA761F532B0DB404C9804CAB6E0D77696DB30818D42B946CA0A5743E068303686EBD4DFF6123349F37D1F53F99BFB94FBBCD890CD01FFE3ABDEF616E1DC81E41F5AD9A6D603C315987AE017A8B7E17C92E1E67FD4391F4F751CA9C7D8C5BC49AB5DA845BD2B0E8DB702D430BFDF829F992DC5A92B134DADC66F340414CA90613C5A86DBA5DC634003E4E4B8DA9DD0F61932FFDFB22E4B2D38F8C41B300934317FC8CF7FA4027D01D85A11905EF7E6EF71BC83DCE908774F3A7864244C19EEFBB599CBC676CCD7A9DAE2DAC83EB8C20588B7E6EEEAEA20D2F8B5B1D8595DF5E5EB8CF0AF9DB8A3322E3EF3C67C7D96E17F8ADB20877CF83C04925782DB218079D672807767127BEEC2378E68A7D65EEBBA31EE8B1718E4E7CD14B3A8A360B73E3A126C56DFB866DF9CAFCF2DAB1E35F7EEB9A04C25BDDFB219B64CC1FEF63E6AD3BA632D22EDF89E8BFEC8AFDA79BAB5E434649DCE283F536AE9CFAE5E42F9D6355DF7C178FA6B86BC667E6F3FE0EE167594AE8C7E55DD3E539683593077B2C4520F4FCF132E300389585C38719ABDA4EAC9AD9D4604E29999D2B9F9B9D75BA83B7A7D41BEFF8FB40839E0D411895028036518AD4DDCACDEB3D14DE4A3B543034ED358192DA0F9446096B6345BA754A253AA1AD34A691B787EB851C64179D3392B6998B9E79882AC220B3D534D6A5B5AA42E4B4AE1F60EE5BA63D65C6DB273B368BCE92245AF9196295370E9840BB39DE37E1FA88964D3B970628333717847D90FAE2A48417BE3AFE9346556B2FD5B957DD4BA18F9AA09F6AA0F96C66B158A465598BC5A34B7E98EA53DF0F57FECE0B4858285F1317A28235553F6ACD05DBB150AC2549C4A62080AFAA1655678A4AB391EA7421099159B64CD9A731D6935251D7FC8753AC3B881AE9119871E48D80CA08424760C0FC254FCD9F89711F4DA659735CF2FCA34B15FA50CF389284743F82F420043D248941723F42CCD5ED746F72A399770974BD7A68423E79F2A4770152F118558654FA523AC797EB23499221EF12C6764A122689FD6AFE2C0701A324BC25C8704F6266C7660471B3139F82843921D9887267B178487A1D4DBA5A08D534B60EEC7C3CB139343BD74C65807114C96B507334CF32401711E471E91A609D5D61102901FB1F414A404252FA95F36A4CA34EC0C412A80A30A7BE91D48B9A59C945CF98535998A5B32F7563C2610CB5632234A5FF3277D33C840ACEAF6560B9165A3E90686999C6AC1672280153309942C614A29396E158C2D591244D49DC81F11DCBE25173BB76CEA34B13F6E8E6382B22B8F711E40626E6FCD744781A15B2BAD0BD9507D24BBA13A85D5487D24C2A2E53A82695F0141C643FFD29B76A722215CBDE0ACCAAA299A42CF583F3BE0D4CAC399AB94371186F0F0710F7204C5C957C04B5437A2612495BB8090BF0B4F648E64CED780C4BA612EE008C5833030C61CE37B221F5A84B1A69668CF2D6BF0E91FA1E577F48C42499206FC29D3D96239A7C686CB744FD1C4E4F6D95504CA638963E400B65CC01844A0129219024097AD629179923BD9D37E29508019F31A48FC0040A1AD35F8B1893F9605241CBEC0348459D3DAACDADAFF1D1C3F1649082CF08324861C261C860B194D45E70C00402690F491EB8F2061D01ECE071334B35E7ED6C839CB488A0A7C10C46A03D008943B4065002A4B1AE348D588CABFD01621FC05E88E4CB6A75616DE1B93AA9C3EA547EAA07EA9E2AE58DC10F3DF42432F28E5664DD703942D1F2CE8C7686A2F63CCA218A4ABCC3900935AF8A899D689295A69448A9771CE505CD146416C31EE506C160240142084C3B63C9D3FACC4590ACB74AA42C38030996F15EA991A3642C419BE07689C000AAE04D7EC754391D992D5CB319246698679649C014A8235B3BB8F711E40726E6FCAD9E219C16E33025B6B6E6B61A25EE204A84C8DC86E7571D083C886CD9D11941CEECC4A720517F351BC1B3C65ED863A30711BA36D1180309DC04011936A293AE22A60ECB8023D9A9023086669BC4561A919840B60ED272564AD8224F553B5C92DA09510D18B189834A8FD6FB6872A311946AF7E62030446347B4731D046772EB36AD613B149BF6264BE920A2B2F9172CAE1238ACD9B9B7DD5DDC650FAB7CD76D9AF86AC9D2725FE885215BE70F49BDA99244947BBDB212101C054CB1D501A1543B460B904C7743100A8B67F95CCD8F0041D2D350588082F1EF106424F58005BCFC7EBB0652BA66B38029450F82524F591B10FD49791D98760148036A806507A13F7EA9C3D29CAA2D4045DC0B04288F15B27C2CA5F4D500D4276334CA20534F76BBB3610343A07CAAFB7580B8002E3554B92E2FEB7D669470C951828E32AA2FF43B5F2B505463501545765808B2411CC7533E96CE6E41287203023CA390368E702DC08AF4CB3007AB9CD0F609178000F2850AE5E3E728BFE5631E0BA44C4B4A3B0C089CB689A3C13483032149A61DB763659635A93162CDA05D6C639567C9D7540D0C34A6DA9A869CA149825BF25021C4A2490902954CD984005291930F35C645493F240D0E5B2C18284749383404F9D4943800C98C59731A83C0F2E64888CBAB0A0339B04C39C392A05E2299A8006FD010F4B51D5A175A683B320998B4F4EB4C1143AE128032D4CC268D4111729BC883D397A4068211B29990B8D09E72F86432A4E380C6804FA47A116CA7C40893A899400218B821C344036538C7848472B162378C1ACE2A21819076A9DD390E264480386FCF9CD0E49D3177822C09FABEC82412C66C09363AF741A06A6B46A0111883621E8F1A85D21FA5D4B813C26C6C412F25441DA0922988BD3102248C5DC25BDA1C18288104AE0FA147F0A06B8AB8C0BE3466AE6ABE34FD098CE63D43A17C7BAB23070EE3A6070D2F862C071460AC8B7D7EF260B7435048F14093A80A8285E60F1C21DB14792D4656E69D6DBC7A54EC2073A519DB6966B916FD8931488EFFECC66A39E2D342BD3E16A976D1B7C4369A1791F669D076793ACE943046DD41342347E935474789D39347081D3D9AA84789CC1B6A796F7E02DEB069B44699C13B3E539C1934C6C6292B654B690A2D1B8A8858D813403F5284546364B61829AB1E2641C3676ABFBB49E40577E36445C3A6B06904054EC1139440314BA8D42066D0763C4A3D15B51E8692CE40C73BFA945F38865639701C8BB250D122591A963ABBCB302E74B4D895A146AABD6B0B0FD918A6A1E18E056AA84440AF5CAC10C1051040D67EA862DA2D91630F6C6332ED98BA51CBB8616ADE6575A69EE2090F10CCE42BDF1809E22D4F397132C1197246999E4AD22941F5046F8C86E00B2E8D0CB89033508AE0FEDD38CA92AF0D7BA79DE9DA80E6CA6C1C9BE90AA11BD5C6BA4F409E8BB253CB55C40692AEB1A663ED308AD206F12905D0D7BD4A757A5049A13B92AAB3AB5F1AD86794DB64A2CE23277AF43D7BCAD7992A57BEAAEE74B1CC1E8C2C0A4E17BC89783F75EF05EFA2350B92B2E29DB7DB092B537F59941C2D77DE4A5CD0FF79593C47497B8BF2E5E2E4B7C53687B15835365EAAE361D5531AC5DE8629B5B947E25B3F4ED20B2FF5EE3CF1A6D7F97A0B3623392E96FD69FE8B3AF34A478CF213F1BBE926F9E4CDDB8BB32BC9D151015253F22D1FDC96CFFA6C9C4C36F1F8B7FCEBE5CA0BBC18785DF43C0AF6DB10F75BC5BF16FF37BFCF4B7408A70B057995440B8D468AD0AA54A7F1A45AF4746109726548E108FAE9300CA9620E64106820C20133B6307B1DB80A1A76024B91EF86E1E7859FEC02EF87CE8E46051DDEF23E8A531D9A54EC8C9B78AB11C42DAF70867715AD32CB04C2AC2BE9706FD8C617CEECE2BB4F71D084AB553AD0323F6E5BEEEFB67E7E44FE61C714B4B1365D7A390FA244E51FD6C8557324D7FBBBC05F41FAA3AA72E6E8920BD787782DD652004BA55A476C97A917A7BAF8A9754EF8AE226E4257E20DEDF21495B7F9EC07EC3CAFE0B43D0B82E81B5B6B8371F9D481FFC58D2ECC1ABD960EF93AF6A338235681E70DDB270C1C9DA5A9835D89C21CD10218FBEAB36FF976A3616CF066B3B140BA5B6A0763A40583B8DB253B8887B2E4C02068CA1D51E813090CE292DB416AE0401F77D121C299B7FC641B3B5D88A4623AAC2B0F025597CE46A68C17926439422F8409B263F876DEF222C748364CAA2176128736ADF461903E7EF353CE1A1D58A3C281F65BCF0FCED66BCEF3446140A3C64167679466993C5D26C95E5D2442F5EDA0F32AAEE34CF0EB16ED7A380F3C7F2B2619DE85D4A4431F16F84EB043FFDF7B5683F8EC6B14025BB8619FA1850B0FD284DEC71FEC2E11D3565D00C8E57468AF8368A381AA0AE970DE45777CA97C7D1F858A44342A5C36EF7E9C2EFDFF689BF7AA980EEB3C667C73B4FEF4F1BC094C2E9F8D95AB8FB23B1839ECA49E60E3F04F873171F334268FCAFFC129FF1154F3E5EE8C2BA74DB8DF2933422A7780969CED769C53EA01855CEE02ED2A5A7D61EB0FFB54052755B8CDB5AB68E3879A5A6DD6B841FC10067EC8CE5629DFA3A53F40D040137A1FBF73C5AA9DB75685439B140BB4D73F4060AFB5286FA39CEFD6206672B933341533A9783E8693E0B64A37A06AC28D1686D40A023FAC949E4A681E4D1ADE50C0E1490FD00007E930AC6999D807EFDAB3ECD076F71FFD543D542E8A1CAE0358B28AFD1D7019255738CBDC3BAE2662DF0B126D8F013678A86B7A2DAEAD8B78AB39775AC8B915C430025FBE7ADDB894445EC2B68A96933AC3A74E9D20BA397FF0C4D19389511E22DC4174A0106882B8C09F0D2322A513890A452E7F40AE1DB5877507B6626EE504D6E29FCEDBE4D1198B1A3CDD95C3F1063DBB76170454F4505DEC409770AD43AA0A6723AE72546AF7155A3BC73FD3C7C3086DAF06C7D3541BF20AE9743AA92377DBB175447EFE348E8350B06F9769AB27246C317D094086617BEFDBEA1C7D7D672395CF4614C098E53EAED1EB14921DEED30D400E431632E7F9503959AD0A6723057A70713FEAA0AD7FB11DC4BC2D40F689A600EAD21931BEBBDF5E7B77BD91BDF42EB7DE46BF1FAF4B1D21FD93F99B7BF5D244AE7084F787BF4EEF017045F99CD731E835C1BCBD11F308F04E4B5A3DB49DB4A6853E9BB74AEB2E0CEFA3942937AB45D1BC04C294BECC493270484419310118465ACA57199BFB50F8A5463314F404D5F2FCDEA4BCEFE7D8CD90D181C8F8B1D97ED8875E189CDFF9E77CA5CD77B7EF195BABEE127AED6C44514AF1DE410EAB5CF0EE32887F8AD1BAFCE2F242F1CC90CAE99C3BDB89A76C8010B84685830B49B411C22322E7020D3FA9C609E2C59DF852F74569D43840645F998A5C5EE484D54675F02ACBDC5CA274735F97BA841D6EB985BFBC56E30DCB52073F526F75EF874C47AB51E160A2EE63E6AD35E354954E730AFCE9E64A21BA2870A012EF94EF18140A95850E1AF8BBC86BA0CD3EA97836BA32CF15D1414D42593C082A12FE6C18F32CFAD225BF2E9D17339E773F42C2131B1139837DFC93F347CFBFD38149EABB2CEE9CB2423011FC39B8B36DD64C1509D5D7A67B7A77D26905B52719ED249EEE9209C9E494D2F8F0A5A899CCA9294A689E5B735614E80B57575E91B00AD20C78625C9D7224739543855FBA9470688F1EFAEA67AFB7687D2DB08D833E8FC2B59FBDF97A99BCDF07C1ABE3CF5EA02613C108AAE60DD3A5514B1FA636A9E6425152FD5DA50F2B527735728A65C41119C232A224451A31359757DEE4F8A80CE4E154FA91A46CFB443478B2FC77701EF8D9CD63D9E09D17FA9F59927E8CBEB0F0D5B14835767C7416F85E92A77973CA52F6DBE2E4D982ADB78B245907408E3231E14A773E384BD7E9BF98C6AF928FA677654F17EA87A7C08CC91F81F3C5F8B399FC0FC6D92394D6B527028143D18A65981E1F09C9F0EE44AAB9423A1646F0F93A2FEF20FCEAC5AB7B4F3CCAEB7DBF62E126BD7F75FCF4D94B0B5059079A6907E6D33A58D255CB22A98F19531FD8581C2CE91B09B43A914F872DA5D33240FEE5595BA4F3036A03E817CFDB82AE136CF54C132DD156DF3447326DE5DD88D0AC343B42EF0CB6C8ACD511AE92532B8776E7BBCF7F3D8B5681195BF95B71AECBD71D2B3FC992973EE56415CB0C5EED2E7B6A5AAD8E04704C98D59E407A8AACF6B02C79B0DA033624BC32699013B9A334DEB755ECE6DC5107ABE3E7615E75A056FD77F2CCA6C0C9AC25E476FA99F92BE554E899C9758A85711667C84EFC6766AE7C640442D155E6014A880EB891DD890E9B428D661A88BEF52290EFC3D0C5B35F5F74EAE2BA4AF931602752D28FA17B31F6F0EB53F7251F9CFAC968B87E3D69350E20C548BF722B678272B0BC14D05566A89EE136B2449964C7B20A84F6A755C62823CEAE70E54375A7ED01D9C8C199980ED6C61DA06D7934003F9301184335CB99A04CF83BAB23392954FBAD792317547B30CD0C50B876A40C0C49F9D40D6895F129071347DFBE962588DA3B8FB6BB7D2AA83B92994041899BD7BE5591941BAA1B61A5C4505D260EDD461A6F6669B6D2785909B4472F24ED26B6D15587BD5E8D417B20F5D52771BBE8CA9407B26EE9616F5E6463EA79D636323319603F3F3971DFA880E999FAB58523ACA08D798E0E5622CB9449132B1039BA870A85CC3A3DE7D0C1B24B4E5D741877DF7058D2C13260AE5723BDDC2D4A915739A47657B465D4151986EB6A60441FA07EB49BD771C2F62AD4F4A9FB605CADE6316BE9626EC96B331C1F7ADA540CCC4E392B0EFD6CA8C32EC4965CE66027464FFCAEB2D374DB3AB499200FC9B7AE073555E78B1965623C2CBF973AAD4B372713047299E3A5835E9572BB749491C9AD2170E037A27B8F9E4EE560A576AEEC2C12B574BADD75E22796FAE460395B6651E9B2F368664EE9FD6C05CF3C72B0543FE8ADB40E43CF59D2BB10C0A93F68028027FBB00B82FC6D79C3B81944261A3944C897ADB40BCE4636918E62D74C24D215589E4A84ECEA42C57063F11C78D1CE17CA6EC44E9CAFC2EBB42306B8BFFCE6ECA2242720E917E33A1D09F12A8E70E605E2F6D219B52C3109DDD38244C8324F89893D277F6911B551A72D31BA90D918E47049A1868C1FAC01AD93588C735C8625EF7824209180C69C1A342A9A7368409E0F685A023BF99B9D75B8BAB4F9B98FB5FF9AA1678FA3F074919B9124660EB272408C9692162897CFB790AEE55B952341E532DAB9404A2404785294BCDB07A92FD6D1BC378E9936C01A4415AE2E43A90B9B80FEA401E232C362A17BB3E02D113DEBEBE943AE633F5CF93B2F68A0ADB4225A0C41C50A9E5A73C1762C14A6401D1CA52F5CA52E2AB8CA5CB08DBE918FC2CC7135BE7178CE6B11953234BDF2B025C11C3E3A4B8900C32287170B381A530689B4386C012104A1CE524AAA6BC5E125A376D795C148A5872D01A65763E7CB7524DCA8E65AD540665A5DD8E4D9C99327F39300FC6DFBA985C094F06D1439501DE96F3197FAD63C348983E6C6DF1031AD7210E170635847E920BC2FED1AA8308994C08ED51A63217E1E9A7CE0CFEDCE433A8C79F246900D2C9B62C77584C590CC4132465B58B4920B53CEC8F154C6F08B4A075573A07C3F80E5A41A71730BC471D42CCB2A657EE5050E3C57037C1ACCD72A079102E451EDFE85C0FEEE3B74540BBFAE3E8D308CB55A9881548CB95A68231853AF1634D9401C926AAE560D646ED68587251E8677A3E6211FA6A7BB461110A1B96E9114B82D2F1D4C424132453D31DFE932A123F3C9D6498E529C84E1A5C40DBF5274D22487B65674D22C132F16ABC8C091CF1144901C00292B3EF8D500126E89F436F93AA096013D74519AB20AC70056CD91EF542E8CCBF322B4751A2DEF8DE08A4090968353EB44DE4EACD1B520D891EF11F420DCC67C07AA1FC05D8225F218E975FADB043D42775C69012284419852F5E14B8B2D2C7AB6D2A2C60F8F70A2AC462C23BA04047C6806C61C9E8DF439B5B519C9C10DF26B7B20EE6C87E3C526A216C7583A265F94B5A328386C26EB81D3B3E5701D0F7C0B847B3BF2C9C66829F8580525570DB43524F2A407DE6341D6488F6508F35C84C07E3520375239D9E68A600EC231E615414B2199FC92400982BA45A3CAE483FEAA49F3B8BF2EA6CB891A842543D4EA06BA7D36BCA0DDBB9CD89F82768E329B424CFA75759DB7808CE9F3DA463C26F77C558563F025E6F432316B7D310755511913A319D10C88BB14200230B0C1188FF54E56620E4C1FDB348C2F00E31B84B9DA823761E301EF2A7E52796C5B1385E25DF8D271A27AE2FAE84D15945B7AA2D475F993DDAF8ED77711E7771ED9BB5ADD562D124054948E2AB716BD9FAA0AEBA66860EFA530675A174539023FABB503D78341B57EF42648976A437BEF48B8A18602D20EC1036C6D4746BAB1D01090EA904E25FF7A5B47B56ED2FAA9AB906ECA06845E34577BBD37AD09D6AB164340EC1DEFD4D617A10BCD3150EF4B6B8275AA34B4F79E7BA3693DE6C5482FA2D20EB93EC9D0A0D755480FA2C19237203308D69272A5994D243D097762824E020B5D1EEB43011A6143D29A3A280DE94A12D71E52239B1A299BFACC891098B1D09BD8895034B4768E190E9BBD209B89FC24191020518C4A50F28506593E3B04FB901B987A73987DCD6350B057529FF41EABEC827A6F7515D49397EC4296DE6C92DB20DA3CE73F09AA512C9501D5288A51D51810045D3E1304E13F370B77D6CB73E2D248DBF96B3D6A2D906E33832D35A4F66DEC96D223DC99B4F8D6D7B2C569CB91D44859D242E731D0894C35A6AA44DB41406EE3D26775A1328245730884E1213958806152B2B5741E2EB6ECCE3ED72B3B0FDF947004A001393F496742187700190CA4456792A8D9350032181370741EBAB632CFBE934A7B1C62BDAF308D123B88000F5B249CEBC249876BC898000C9B9A5FA1CB209AA44336643909B5CAFEC9516D8208C440FCE3A100007D14B3220316050F50811430DF79DE4F2407B89A330484F735588A94B4191A18DC0C0DD11E05AD5C26D4BBFB0CE7BCC03450E434221FB156D9FFD04DB39B14F6DBCFEC9E9A0CF5B6894007CCBF020C4D93065217CE8814CDF84C60F88600CEF66B71F769D362684A2422303653AC626725E62403ED35B41C7687AB693438AF4FEB2C9DD8C99F66C57D0E3703681C2A1066A3C615C94CD1111C7D7875401524A770B4557711B513A20DA74CD14310DFC8D146FDADAAD143E09CB340757FFB2A284CC6B4C3B286D5F44616FC5CBA0944AAEE535AE47810B39CA09123DD979EC8A9B82A17F031779BE15B4E96863C5082CE91FA3B3E923CFD419D06C701F4A0D4EA73FF42AB89825E86A3BAB523E3327ABFBB23AB7DA15F3E54DFCA55430CD9B45226FB7C6B034287435A338F491283AB324011AA63B3B21E56EF2B8A55715D6C200672019181D0EA7A2787E9C890E6BEDBD3C1E1B464200BC4100A708AA1D79E96E8A011674C4DF435A1270C161967FF43B4CBF758A2DDCF90CB17282AEFB9AAEE7491DF121605FCCF348ABD0D7B17AD599064A5A78B9B7D281ED0C8FFBA6089BFA9419C7298215B35BCF5AA3697E1E7A8741C54302A9B68CF4DA5DEDA4BBDB338F53F7BAB9457AFC4064C1C2EFCEE057B3159B6776C7D197ED8A7BB7DCA87CCB6774163892A9C0F4DFD9F2E349C4F3F644F51257D0C81A3E98B37473E84D9B94885F75BE065100484F06A2C5E3B12BC4CC5AB479B1F15A4F75148045490AF72C6FCC8B6BB80034B3E844BEF2BC371B3D3B049B1D30BDFE39B85AD4CC1BCA45C017BBC67A90BDE81FC45DD1FFF938BEB7AFBFD6FFF0FB277DD89C7CC0100, '4.3.1')
			End;
		End;		
	End;

End;
GO
